home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / ImageCodec.h < prev    next >
Text File  |  1995-07-06  |  7KB  |  249 lines

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.0
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __IMAGECODEC__
  21. #define __IMAGECODEC__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <QuickdrawText.h>                                    */
  34.  
  35. #ifndef __QDOFFSCREEN__
  36. #include <QDOffscreen.h>
  37. #endif
  38. /*    #include <Errors.h>                                            */
  39.  
  40. #ifndef __WINDOWS__
  41. #include <Windows.h>
  42. #endif
  43. /*    #include <Memory.h>                                            */
  44. /*    #include <Events.h>                                            */
  45. /*        #include <OSUtils.h>                                    */
  46. /*    #include <Controls.h>                                        */
  47. /*        #include <Menus.h>                                        */
  48.  
  49. #ifndef __IMAGECOMPRESSION__
  50. #include <ImageCompression.h>
  51. #endif
  52. /*    #include <Components.h>                                        */
  53. /*    #include <StandardFile.h>                                    */
  54. /*        #include <Dialogs.h>                                    */
  55. /*            #include <TextEdit.h>                                */
  56. /*        #include <Files.h>                                        */
  57. /*            #include <Finder.h>                                    */
  58.  
  59. #ifndef __COMPONENTS__
  60. #include <Components.h>
  61. #endif
  62.  
  63. #ifndef __MOVIES__
  64. #include <Movies.h>
  65. #endif
  66. /*    #include <Aliases.h>                                        */
  67. /*        #include <AppleTalk.h>                                    */
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73. #if PRAGMA_ALIGN_SUPPORTED
  74. #pragma options align=mac68k
  75. #endif
  76.  
  77. #if PRAGMA_IMPORT_SUPPORTED
  78. #pragma import on
  79. #endif
  80.  
  81.  
  82. enum {
  83.     codecGetCodecInfo            = 0x00,
  84.     codecGetCompressionTime        = 0x01,
  85.     codecGetMaxCompressionSize    = 0x02,
  86.     codecPreCompress            = 0x03,
  87.     codecBandCompress            = 0x04,
  88.     codecPreDecompress            = 0x05,
  89.     codecBandDecompress            = 0x06,
  90.     codecCDSequenceBusy            = 0x07,
  91.     codecGetCompressedImageSize    = 0x08,
  92.     codecGetSimilarity            = 0x09,
  93.     codecTrimImage                = 0x0A,
  94.     codecRequestSettings        = 0x0B,
  95.     codecGetSettings            = 0x0C,
  96.     codecSetSettings            = 0x0D,
  97.     codecCDSequenceFlush        = 0x0E,
  98.     codecSetTimeCode            = 0x0F
  99. };
  100.  
  101. enum {
  102.     codecCanScale                = 1L << 0,
  103.     codecCanMask                = 1L << 1,
  104.     codecCanMatte                = 1L << 2,
  105.     codecCanTransform            = 1L << 3,
  106.     codecCanTransferMode        = 1L << 4,
  107.     codecCanCopyPrev            = 1L << 5,
  108.     codecCanSpool                = 1L << 6,
  109.     codecCanClipVertical        = 1L << 7,
  110.     codecCanClipRectangular        = 1L << 8,
  111.     codecCanRemapColor            = 1L << 9,
  112.     codecCanFastDither            = 1L << 10,
  113.     codecCanSrcExtract            = 1L << 11,
  114.     codecCanCopyPrevComp        = 1L << 12,
  115.     codecCanAsync                = 1L << 13,
  116.     codecCanMakeMask            = 1L << 14,
  117.     codecCanShift                = 1L << 15,
  118.     codecCanAsyncWhen            = 1L << 16,
  119.     codecCanShieldCursor        = 1L << 17,
  120.     codecCanManagePrevBuffer    = 1L << 18
  121. };
  122.  
  123. struct CodecCapabilities {
  124.     long                            flags;
  125.     short                            wantedPixelSize;
  126.     short                            extendWidth;
  127.     short                            extendHeight;
  128.     short                            bandMin;
  129.     short                            bandInc;
  130.     short                            pad;
  131.     unsigned long                    time;
  132. };
  133. typedef struct CodecCapabilities CodecCapabilities;
  134.  
  135.  
  136. enum {
  137.     codecConditionFirstBand        = 1L << 0,
  138.     codecConditionLastBand        = 1L << 1,
  139.     codecConditionFirstFrame    = 1L << 2,
  140.     codecConditionNewDepth        = 1L << 3,
  141.     codecConditionNewTransform    = 1L << 4,
  142.     codecConditionNewSrcRect    = 1L << 5,
  143.     codecConditionNewMask        = 1L << 6,
  144.     codecConditionNewMatte        = 1L << 7,
  145.     codecConditionNewTransferMode = 1L << 8,
  146.     codecConditionNewClut        = 1L << 9,
  147.     codecConditionNewAccuracy    = 1L << 10,
  148.     codecConditionNewDestination = 1L << 11,
  149.     codecConditionFirstScreen    = 1L << 12,
  150.     codecConditionDoCursor        = 1L << 13,
  151.     codecConditionCatchUpDiff    = 1L << 14,
  152.     codecConditionCodecChangedMask = 1L << 31
  153. };
  154.  
  155. enum {
  156.     codecInfoResourceType        = 'cdci',
  157.     codecInterfaceVersion        = 2
  158. };
  159.  
  160. struct CodecCompressParams {
  161.     ImageSequence                    sequenceID;
  162.     ImageDescriptionHandle            imageDescription;
  163.     Ptr                                data;
  164.     long                            bufferSize;
  165.     long                            frameNumber;
  166.     long                            startLine;
  167.     long                            stopLine;
  168.     long                            conditionFlags;
  169.     CodecFlags                        callerFlags;
  170.     CodecCapabilities                *capabilities;
  171.     ICMProgressProcRecord            progressProcRecord;
  172.     ICMCompletionProcRecord            completionProcRecord;
  173.     ICMFlushProcRecord                flushProcRecord;
  174.     PixMap                            srcPixMap;
  175.     PixMap                            prevPixMap;
  176.     CodecQ                            spatialQuality;
  177.     CodecQ                            temporalQuality;
  178.     Fixed                            similarity;
  179.     DataRateParamsPtr                dataRateParams;
  180.     long                            reserved;
  181. };
  182. typedef struct CodecCompressParams CodecCompressParams;
  183.  
  184. struct CodecDecompressParams {
  185.     ImageSequence                    sequenceID;
  186.     ImageDescriptionHandle            imageDescription;
  187.     Ptr                                data;
  188.     long                            bufferSize;
  189.     long                            frameNumber;
  190.     long                            startLine;
  191.     long                            stopLine;
  192.     long                            conditionFlags;
  193.     CodecFlags                        callerFlags;
  194.     CodecCapabilities                *capabilities;
  195.     ICMProgressProcRecord            progressProcRecord;
  196.     ICMCompletionProcRecord            completionProcRecord;
  197.     ICMDataProcRecord                dataProcRecord;
  198.     CGrafPtr                        port;
  199.     PixMap                            dstPixMap;
  200.     BitMapPtr                        maskBits;
  201.     PixMapPtr                        mattePixMap;
  202.     Rect                            srcRect;
  203.     MatrixRecord                    *matrix;
  204.     CodecQ                            accuracy;
  205.     short                            transferMode;
  206.     ICMFrameTimePtr                    frameTime;
  207.     long                            reserved[1];
  208.     SInt8                            matrixFlags;
  209.     SInt8                            matrixType;
  210.     Rect                            dstRect;
  211. };
  212. typedef struct CodecDecompressParams CodecDecompressParams;
  213.  
  214.  
  215. enum {
  216.     matrixFlagScale2x            = 1L << 7
  217. };
  218.  
  219. extern pascal ComponentResult CDGetCodecInfo(Handle storage, CodecInfo *info);
  220. extern pascal ComponentResult CDGetCompressionTime(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
  221. extern pascal ComponentResult CDGetMaxCompressionSize(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
  222. extern pascal ComponentResult CDPreCompress(Handle storage, CodecCompressParams *params);
  223. extern pascal ComponentResult CDBandCompress(Handle storage, CodecCompressParams *params);
  224. extern pascal ComponentResult CDPreDecompress(Handle storage, CodecDecompressParams *params);
  225. extern pascal ComponentResult CDBandDecompress(Handle storage, CodecDecompressParams *params);
  226. extern pascal ComponentResult CDCodecBusy(Handle storage, ImageSequence seq);
  227. extern pascal ComponentResult CDGetCompressedImageSize(Handle storage, ImageDescriptionHandle desc, Ptr data, long bufferSize, ICMDataProcRecordPtr dataProc, long *dataSize);
  228. extern pascal ComponentResult CDGetSimilarity(Handle storage, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
  229. extern pascal ComponentResult CDTrimImage(Handle storage, ImageDescriptionHandle Desc, Ptr inData, long inBufferSize, ICMDataProcRecordPtr dataProc, Ptr outData, long outBufferSize, ICMFlushProcRecordPtr flushProc, Rect *trimRect, ICMProgressProcRecordPtr progressProc);
  230. extern pascal ComponentResult CDRequestSettings(Handle storage, Handle settings, Rect *rp, ModalFilterUPP filterProc);
  231. extern pascal ComponentResult CDGetSettings(Handle storage, Handle settings);
  232. extern pascal ComponentResult CDSetSettings(Handle storage, Handle settings);
  233. extern pascal ComponentResult CDCodecFlush(Handle storage);
  234. extern pascal ComponentResult CDCodecSetTimeCode(Handle storage, void *timeCodeFormat, void *timeCodeTime);
  235.  
  236. #if PRAGMA_IMPORT_SUPPORTED
  237. #pragma import off
  238. #endif
  239.  
  240. #if PRAGMA_ALIGN_SUPPORTED
  241. #pragma options align=reset
  242. #endif
  243.  
  244. #ifdef __cplusplus
  245. }
  246. #endif
  247.  
  248. #endif /* __IMAGECODEC__ */
  249.